package day1;

import java.util.Arrays;
import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        long a = 0;
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long[] array = new long[3*n];
        for (int i = 0; i < array.length; i++) {
            array[i] = scanner.nextLong();
        }
        Arrays.sort(array);
        for (int i = 0; i < n; i++) {
            a += array[array.length-(2*(i+1))];
        }
        System.out.println(a);
    }
}
